package org.northking.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Component;

@Component
public abstract class FruitShop {
    @Autowired
    @Qualifier("apple")
    private Fruit apple;
    @Autowired
    @Qualifier("strawberry")
    private Fruit strawberry;
    @Autowired
    @Qualifier("mango")
    private Fruit mango;
    public Double getApplePrice(int count) {
        return apple.getPrice() * count;
    }

    public Double getStrawberryPrice(int count) {
        return strawberry.getPrice() * count;
    }

    public Double getMangoPrice(int count) {
        return mango.getPrice() * count;
    }

    public abstract Double totalPrice(int...count);
}
